<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>sys::PlatformService</title>
  <meta http-equiv='Content-type' content='text/html;charset=UTF-8' />
  <link rel='stylesheet' type='text/css' href='../style.css'/>
</head>
<body>
<p>
  <a href='../index.html'>
    <img src='../logo.png' alt='Sedona'/>
  </a>
</p>
<div class='nav'>
  <a href='../index.html'>Index</a> |
  <a href='../api.html'>Kits</a> |
  <a href='index.html'>sys</a>
</div>
<h1 class='title'>sys::PlatformService</h1>
<hr/>
<pre class='inheritance'><a href='../sys/Obj.html'>sys::Obj</a>
  <a href='../sys/Virtual.html'>sys::Virtual</a>
    <a href='../sys/Component.html'>sys::Component</a>
      <a href='../sys/Service.html'>sys::Service</a>
        sys::PlatformService
</pre>
<em>public </em> class <b>PlatformService</b>  [niagaraIcon=&#x22;module://icons/x16/platform.png&#x22;]<br>
<hr/>
<p>PlatformService is a service designed for a &#xa;specific hardware/OS platform.</p>
<hr/>
<dl>
<dt>execute</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>void execute()</b>

</code></p>
</dd>
<dt>fileStore</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> </em><b><a href='../sys/FileStore.html'>FileStore</a> fileStore(<a href='../sys/Str.html'>Str</a> name)</b>

</code></p>
<p>Map a filename to its FileStore implementation.  This&#xa;method must return a non-null reference.  Default is &#xa;to return &#x27;FileStore.sys&#x27;.</p>
</dd>
<dt>init</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> </em><b>int init(<a href='../sys/Str.html'>Str</a>[] args, int argsLen)</b>

</code></p>
<p>Initialize the platform with the command line arguments. &#xa;Return 0 on success.  Return  non-zero on failure, which will&#xa;terminate the process.</p>
</dd>
<dt>lookup</dt>
<dd><p class='sig'><code><em><em>public</em> <em>static</em> </em><b><a href='../sys/PlatformService.html'>PlatformService</a> lookup()</b>

</code></p>
<p>Lookup the platform service for this VM.  Return&#xa;null if the application hasn&#x27;t boot yet or is missing&#xa;a platform service.</p>
</dd>
<dt>memAvailable</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>long memAvailable</b> [readonly]

</code></p>
<p>The amount of available runtime memory, in bytes. This property&#xa;must be updated during execute()</p>
</dd>
<dt>notify</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> </em><b>void notify(<a href='../sys/Str.html'>Str</a> key, <a href='../sys/Str.html'>Str</a> val)</b>

</code></p>
<p>Notify the platform of a name/value pair setting&#xa;or state change.</p>
</dd>
<dt>platformId</dt>
<dd><p class='sig'><code><em><em>public</em> <em>inline</em> <em>property</em> </em><b><a href='../sys/Buf.html'>Buf</a> platformId</b> [asStr, max=128, readonly]

</code></p>
<p>The platform identifier which defines how this&#xa;Sedona device should be provisioned.</p>
</dd>
<dt>reboot</dt>
<dd><p class='sig'><code><em><em>public</em> <em>action</em> </em><b>void reboot()</b> [confirmRequired]

</code></p>
<p>Action to reboot the entire host platform.  This typically &#xa;means to reboot the entire operating system.</p>
</dd>
<dt>refreshMemory</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> </em><b>void refreshMemory()</b>

</code></p>
<p>Update the memAvailable property to reflect the current &#xa;amount of available memory.</p>
</dd>
<dt>restart</dt>
<dd><p class='sig'><code><em><em>public</em> <em>action</em> </em><b>void restart()</b> [confirmRequired]

</code></p>
<p>Action to restart the Sedona application on the host platform.  &#xa;This typically means restart just the Sedona process.</p>
</dd>
<dt>start</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>void start()</b>

</code></p>
</dd>
<dt>updatePlatformId</dt>
<dd><p class='sig'><code><em><em>public</em> </em><b>void updatePlatformId(<a href='../sys/Str.html'>Str</a> id)</b>

</code></p>
<p>Convenience to set the platformId property, and call changed()</p>
</dd>
<dt>yield</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> </em><b>void yield(long yieldTime)</b>

</code></p>
<p>Inform platform that SVM will be exiting with Err.yield and needs &#xa;to be scheduled to run again (via resume in vm.c) in ns nanoseconds to meet&#xa;the desired App.scanPeriod value.</p>
<p>If the application overruns its scan period, yieldTime will be negative. &#xa;In this case the VM should be scheduled to run again as soon as possible.</p>
<p>See also the Apps chapter in Sedona docs</p>
</dd>
<dt>yieldRequired</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> </em><b>bool yieldRequired()</b>

</code></p>
<p>Return true if App must yield CPU by exiting VM each cycle.</p>
<p>Platforms that support pre-emptive multitasking should return false&#xa;since App can sleep to yield CPU.</p>
<p>Cooperative multitasking platforms that expect tasks to run to&#xa;completion and return so other tasks can execute should return true.</p>
<p>See also the Apps chapter in Sedona docs</p>
</dd>
</dl>
<div class='nav'>
  <a href='../index.html'>Index</a> |
  <a href='../api.html'>Kits</a> |
  <a href='index.html'>sys</a>
</div>
<div class='copyright'>Copyright &#169; 2009, Tridium, Inc.</div>
</body>
</html>
